#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
#define maxn 10001
#define maxm 1000001
#define MAX_COLOR_NUM 2
#define BLACK 0
#define WHITE 1

int n,m;
vector<int> conn_matrix[maxn];
bool used[maxn];
bool _color[maxn];
int sum[MAX_COLOR_NUM];
int ans=0;

bool dfs(int u, int p, bool color){
	if(used[u]){
		if(_color[u]==color) return true;
		else return false;
	}
	_color[u]=color;
	sum[color]++;
	used[u]=true;
	bool ret=true;
	for(auto v : conn_matrix[u]){
		if(!ret) break;
		if(v!=p)
			ret &= dfs(v,u,!color);
	}
	//used[u]=false;
	return ret;
}

int main(){
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int u,v;
		cin>>u>>v;
		conn_matrix[u].push_back(v);
		conn_matrix[v].push_back(u);
	}
	for(int i=1;i<=n;i++){
		if(used[i]) continue;
		memset(sum,0,sizeof(sum));
		bool ret = dfs(i,0,BLACK);
		if(!ret){
			cout<<"Impossible"<<endl;
			return 0;
		}
		ans+=min(sum[BLACK],sum[WHITE]);
	}
	cout<<ans<<endl;
	return 0;
}